<template>
	<view>
		<textarea placeholder="请输入评论标题" v-model="title" auto-height></textarea>
		<textarea placeholder="请输入评论内容" v-model="content" auto-height style="min-height: 400rpx;margin-top: 40rpx;"></textarea>
	    <button class="bu" style="margin-top: 40rpx;" @click="submit" :disabled="title === '' || content === '' ? true : false">提交</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title: '',
				content: ''
			};
		},
		methods: {
			submit(){
				this.$request({
					url: '/prod-api/api/common/feedback',
					method: 'POST',
					data: {
						title: this.title,
						content: this.content
					}
				}).then(res => {
					if (res.code === 200) {
						uni.showToast({
							title: '提交成功'
						})
						setTimeout(() => {
							uni.reLaunch({
								url: '/pages/user/user'
							})
						}, 1000)
					} else {
						uni.showToast({
							title: res.msg,
							icon: 'error'
						})
					}
				})
			}
		}
	}
</script>

<style lang="scss">
view{
	padding: 20rpx;
	textarea{
		min-height: 80rpx;
		margin: 20rpx auto;
		border: 2rpx solid #e4e7ed;
		padding: 20rpx;
		border-radius: 20rpx;
	}
}
</style>
